home *** CD-ROM | disk | FTP | other *** search
- unit ntc_client_about;
- {
- Copyright (C) 2004 - 2006 Andrew Sprott
-
- http://astronomy.crysania.co.uk
- astro@trefach.co.uk
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- }
-
- interface
-
- uses
- Windows,
- Messages,
- SysUtils,
- Variants,
- Classes,
- Graphics,
- Controls,
- Forms,
- Dialogs,
- StdCtrls,
- ExtCtrls,
- inifiles,
-
- ntc_client_form;
-
- type
- Tscope_about = class(TForm)
- about_panel: TPanel;
- about_icon: TImage;
- copyright_label_1: TLabel;
- copyright_label_2: TLabel;
- copyright_label_3: TLabel;
- copyright_label_4: TLabel;
- message_label_1: TLabel;
- message_label_2: TLabel;
- trefach_url_label: TLabel;
- Label1: TLabel;
- Label2: TLabel;
- Image1: TImage;
-
- { methods }
- procedure formcreate(
- Sender:TObject);
-
- procedure FormShow(
- Sender: TObject);
-
- procedure form_close_query(
- Sender: TObject;
- var CanClose: Boolean);
-
- procedure adjust;
-
- procedure load_settings;
-
- procedure save_settings;
-
- procedure check_activate(
- Sender: TObject);
-
- private
- { Private declarations }
- public
- { Public declarations }
- { configuration }
- dimensions:dimensions_record;
-
- { events }
- procedure check_visible_and_show_hide(
- sender:tobject);
-
- procedure hide_form;
- procedure show_form;
- end;
-
- var
- scope_about: Tscope_about;
-
- implementation
-
- {$R *.dfm}
-
- procedure tscope_about.formcreate(
- Sender:TObject);
- begin
- load_settings;
- end;
-
- procedure Tscope_about.FormShow(
- Sender: TObject);
- begin
- with dimensions do
- begin
- top:=form_top;
- left:=form_left;
- end;
- end;
-
- procedure tscope_about.form_close_query(
- Sender: TObject;
- var CanClose: Boolean);
- begin
- canclose:=false;
- visible:=false;
- with dimensions do
- begin
- form_top:=top;
- form_left:=left;
- end;
- end;
-
- procedure tscope_about.adjust;
- begin
- with dimensions do
- begin
- form_top:=trunc(form_top/last_screen_height*current_height);
- form_left:=trunc(form_left/last_screen_width*current_width);
- end;
- if visible then
- show;
- end;
-
- procedure tscope_about.check_visible_and_show_hide(
- sender:tobject);
- begin
- if visible then
- hide_form
- else
- show_form;
- scope.show_hide(sender,visible);
- end;
-
- procedure tscope_about.hide_form;
- begin
- with dimensions do
- begin
- form_top:=top;
- form_left:=left;
- end;
- Visible:=false;
- end;
-
- procedure tscope_about.show_form;
- begin
- Visible:=true;
- end;
-
- procedure tscope_about.load_settings;
- begin
- ini_file:=tinifile.create(application_path+'client.ini');
- with ini_file do
- begin
- { form }
- scope.get_dimensions(scope_about,@dimensions,'about',ini_file);
- left:=dimensions.form_left;
- top:=dimensions.form_top;
- visible:=readbool('about','visible',false);
- end;
- ini_file.free;
- end;
-
- procedure tscope_about.save_settings;
- begin
- with ini_file do
- begin
- { form }
- scope.find_vdu(scope_about,@dimensions);
- scope.write_dimensions(@dimensions,left,top,'about',ini_file);
- writebool('about','visible',visible);
- end;
- end;
-
- procedure Tscope_about.check_activate(
- Sender: TObject);
- begin
- scope.form_activate(scope_about,@dimensions);
- end;
-
- end.
-